//
//  CompleteUserInfoController.m
//  ProjectDemo
//
//  Created by IOS3 on 2018/11/1.
//  Copyright © 2018 IOS3. All rights reserved.
//

#import "CompleteUserInfoController.h"

@interface CompleteUserInfoController () <UIPickerViewDataSource, UIPickerViewDelegate>

@property (weak, nonatomic) IBOutlet UIButton *studentIDTypeButton;
@property (weak, nonatomic) IBOutlet UIButton *teacherIDTypeButton;

@property (weak, nonatomic) IBOutlet UITextField *nickNameTextField;
@property (weak, nonatomic) IBOutlet UIButton *chooseSchoolButton;
@property (weak, nonatomic) IBOutlet UIButton *chooseSpecialtyButton;
@property (weak, nonatomic) IBOutlet UIButton *chooseEducationButton;

@property (nonatomic, strong) UIButton *selectedButton;
@property (nonatomic, strong) UIPickerView *picker;

@end

@implementation CompleteUserInfoController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initializes];
}

- (void)initializes {
    self.title = @"信息完善";
    
    
    
}
- (IBAction)identifyButtonClick:(UIButton *)sender {
    sender.selected = !sender.isSelected;
    if (self.selectedButton) {
        self.selectedButton.selected = !self.selectedButton.isSelected;
    }
    self.selectedButton = sender;
    
}

- (IBAction)chooseButtonClick:(UIButton *)sender {
    
    self.picker.frame = CGRectMake(100, CGRectGetMaxY(sender.frame), 200, 300);
    [self.view addSubview:self.picker];
}

- (IBAction)ensureButtonClick:(UIButton *)sender {
}





- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
    return 1;
}


- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
    return 9;
}

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
    return @"options";
}

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
    NSLog(@"%ld, %ld", row, component);
    
}


- (UIPickerView *)picker {
    if (!_picker) {
        _picker = [[UIPickerView alloc] init];
        _picker.frame = CGRectMake(50, 200, 200, 200);
        _picker.backgroundColor = UIColor.grayColor;
        _picker.dataSource = self;
        _picker.delegate = self;
    }
    return _picker;
}
@end
